Many businesses provide access to their products and services through applications that are delivered over computer networks such as the Internet. These applications typically have a multi-tiered architecture. In those cases where the applications are delivered over the Internet they are commonly referred to as Web-based applications. FIG. 1 is a block diagram of a Web-based application 100 having a multi-tiered architecture.
Web-based application 100 includes client layer 110, application layer 120, and data layer 130. Client layer 110 includes user interface 112 that runs on a client computing device such as a desktop computer, laptop computer, personal digital assistant, telephone, and the like. In a Web-based environment, user interface 112 is typically a Web browser. User interface 112 may collect input from a user and provide that input to application layer 120 for processing.
Application layer 120 includes application server 122 to receive and process input from client layer 110. Application server 122 typically includes a number of subcomponents including, for example, connectivity layer 140, presentation logic 142, business logic 144, and database interface 146. Connectivity layer 140 provides connections to client layer 110 using protocols such as the HyperText Transfer Protocol (HTTP), HTTP secured through the Secure Socket Layer, the Simple Object Access Protocol (SOAP), and the like. The HTTP protocol refers to any of the HTTP protocols including, for example, the protocol described in Request For Comments (RFC) 2616 entitled, “HyperText Transport Protocol—HTTP/1.1,” June 1999 (hereinafter, the HTTP protocol). The SOAP protocol refers to any of the SOAP protocols including the one promulgated by the World Wide Consortium (W3C) entitled, “SOAP Version 1.1 Part 1: Messaging Framework and Part 2: Adjuncts,” 24 Jun. 2003 (hereinafter, the SOAP protocol). The Secure Socket Layer protocol refers to any of the Secure Socket Layer protocols including, for example, the protocol entitled, “The SSL Protocol Ver. 3.0,” Nov. 18, 1996 (the HTTPS protocol).
Presentation logic 142 generates a Graphical User Interface (GUI) using, for example, a markup language such as the Hyper Text Markup Language (HTML). Business logic 144 represents the core of the application, for example, the rules governing the underlying business process (or other functionality) provided by the application. The Java 2 Enterprise Edition Specification v1.3, published on Jul. 27, 2001 (the J2EE specification) defines an increasingly popular architecture for application layer 120.
Data layer 130 includes data access logic used by business logic 144 to store and retrieve data in database 132. Database 132 provides non-volatile storage (sometimes referred to as a persistent store) for the data accessed and/or processed by application layer 120. Database 132 may be, for example, a relational database or an object-oriented database. Database interface 146 provides an interface between business logic 144 and data layer 130.
Typically, an application in application layer 120 uses a transaction to interact with persistent data in data layer 130. Related database operations are often grouped together into a unit of work that forms a logical operation from the application's perspective. The term “transaction” refers to such units of work and additionally refers to ensuring that concurrent units of work are executed in an atomic, consistent, isolated, and durable manner as if the concurrent units of work were executed serially one after the other. The term “transaction” refers to a series of database operations that form a unit with regard to backup and synchronization (e.g., a read transaction or a write transaction). The application should (at least to a degree) have some control of the transaction. Controlling transactions is particularly important for Web application 100 because it includes a variety of different component types (e.g., arbitrary Java code, Enterprise JavaBeans, servlets, portals, and the like).
The J2EE specification defines a transaction mechanism in the Java Transaction Application Program Interface (JTA). The JTA applies to standard J2EE components such as Enterprise JavaBeans, Session Beans, and Java Messaging Service components. In the JTA environment, (e.g., with container-managed transactions) transactions are controlled by metadata that is interpreted by, for example, a container. More specifically, JTA provides programmatic transaction demarcation. An Enterprise JavaBean container provides container-managed transactions that are declaratively processed via metadata.
Many applications (e.g., Web application 100) include code (e.g., arbitrary Java code) that is not part of a standard J2EE component. Container-managed transactions, however, are available only for Enterprise JavaBeans. In addition, some of the functionality provided by the JTA environment is not programmatically accessible. That is, the functionality includes private methods that are accessible to, for example, a container but not accessible to an application programmer.